// 通用响应类型
export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
  success: boolean
}

// 分页响应类型
export interface PageResponse<T = any> {
  list: T[]
  total: number
  pageNum: number
  pageSize: number
}

// 微信用户信息类型
export interface WechatUserInfo {
  openid: string
  nickname: string
  headimgurl: string
  sex: number
  province: string
  city: string
  country: string
  unionid?: string
}

// 微信JS-SDK配置类型
export interface WechatConfig {
  appId: string
  timestamp: number
  nonceStr: string
  signature: string
  jsApiList: string[]
}

// 表单选项类型
export interface FormOption {
  label: string
  value: string | number
}

// 上传文件类型
export interface UploadFile {
  name: string
  url: string
  size: number
  type: string
}

// 路由元信息类型
declare module 'vue-router' {
  interface RouteMeta {
    title?: string
    requiresAuth?: boolean
    keepAlive?: boolean
  }
}